@(account: gitbucket.core.model.Account, sshKeys: List[gitbucket.core.model.SshKey])(implicit context: gitbucket.core.controller.Context)
@import gitbucket.core.ssh.SshUtil
@import context._
@import gitbucket.core.view.helpers._
@html.main("SSH Keys"){
<div class="container body">
  <div class="row">
    <div class="col-md-3">
      @menu("ssh", settings.ssh)
    </div>
    <div class="col-md-9">
      <div class="panel panel-default">
        <div class="panel-heading strong">SSH Keys</div>
        <div class="panel-body">
          @if(sshKeys.isEmpty){
            No keys
          }
          @sshKeys.zipWithIndex.map { case (key, i) =>
            @if(i != 0){
              <hr style="margin-top: 10px;">
            }
            <strong>@key.title</strong> (@SshUtil.fingerPrint(key.publicKey).getOrElse("Key is invalid."))
            <a href="@path/@account.userName/_ssh/delete/@key.sshKeyId" class="btn btn-sm btn-danger pull-right">Delete</a>
          }
        </div>
      </div>
      <form method="POST" action="@path/@account.userName/_ssh" validate="true">
        <div class="panel panel-default">
          <div class="panel-heading strong">Add an SSH Key</div>
          <div class="panel-body">
            <fieldset class="form-group">
              <label for="title" class="strong">Title</label>
              <div><span id="error-title" class="error"></span></div>
              <input type="text" name="title" id="title" class="form-control"/>
            </fieldset>
            <fieldset class="form-group">
              <label for="publicKey" class="strong">Key</label>
              <div><span id="error-publicKey" class="error"></span></div>
              <textarea name="publicKey" id="publicKey" class="form-control" style="height: 250px;"></textarea>
            </fieldset>
            <input type="submit" class="btn btn-success" value="Add"/>
          </div>
        </div>
      </form>
    </div>
  </div>
</div>
}
